using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using RikMigrations.Providers;

namespace RikMigrations
{
	public abstract class Command
	{
		public abstract void Execute(DbProvider db);
	}

	public delegate void CommandExecuteDelegate(DbProvider db);

	public class CommandBase : Command
	{
		CommandExecuteDelegate executeCommand;

		public CommandBase(CommandExecuteDelegate executeCommand)
		{
			if (executeCommand == null)
				throw new ArgumentNullException("executeCommmand");
			this.executeCommand = executeCommand;
		}

		public override void Execute(DbProvider db)
		{
			executeCommand(db);
		}
	}
}